package com.itbaizhan;

import java.util.Arrays;

/*
* 使用Object数组存储表格数据：
*/
public class TestObject {
    public static void main(String[] args) {
        Object[] a0 = {"工号","姓名","年龄","岗位","薪资","补助"};
        Object[] a1 = {1001,"高 淇",18,"程序员",30000,5000};
        Object[] a2 = {1002,"高小二",19,"讲 师",35000,2000};
        Object[] a3 = {1003,"高小松",20,"教 授",20000,3000};
        //声明二维数组
        Object[][] temps = new Object[4][];
        temps[0] = a0;
        temps[1] = a1;
        temps[2] = a2;
        temps[3] = a3;

        System.out.println("======打印数组的值=====");
        for (int i=0;i<temps.length;i++){
            System.out.println(Arrays.toString(temps[i]));
        }
        System.out.println("=====遍历======");
        for(int i=0;i<temps.length;i++){  //打印数组
            for (int j=0;j<temps[i].length;j++){  //打印数组里的元素
                System.out.print(temps[i][j]+"\t");
            }
            System.out.println();
        }
    }
}
